package org.huamoxi.config;

import feign.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignConfig {

    @Value("${feign.loggerLevel}")
    String loggerLevel;

    @Bean
    public Logger.Level feignLoggerLevel() {
        return "none".equalsIgnoreCase(loggerLevel) ?
            Logger.Level.NONE: "basic".equalsIgnoreCase(loggerLevel) ? Logger.Level.BASIC:
                "headers".equalsIgnoreCase(loggerLevel) ? Logger.Level.HEADERS : Logger.Level.FULL;
    }
}
